package interfaceandabstract.exercise;

public class Dog extends Animal implements CatchMouse,Swim {

    public Dog() {
    }

    public Dog(String gender, String alias, int age, int speed) {
        super(gender, alias, age, speed);
    }

    @Override
    public boolean catchMouse(Mouse m) {

        if(this.speed>m.speed){ //能否捉到老鼠取决于速度
            return  true;
        }
        return false;
    }

    @Override
    public void swim() {
        System.out.println("我会狗刨，我也会游泳...");
    }

    @Override
    public void bark() {
        System.out.println("汪汪..");
    }
}
